From ac1758697335c3d9e5950c9ad65dd43aa345f0b5 Mon Sep 17 00:00:00 2001
From: webchick <drupal@webchick.net>
Date: Tue, 18 Aug 2015 14:25:32 -0400
Subject: [PATCH] Issue #2409441 by phenaproxima, quietone, oadaeh, mikeryan:
 Migration path for Text 7.x

---
 .../migrate_drupal/src/Tests/Table/d7/Variable.php |  5 ++-
 .../src/Tests/d6/MigrateDrupal6Test.php            |  2 +-
 .../text/migration_templates/d6_text_settings.yml  | 13 ------
 .../text/migration_templates/text_settings.yml     | 14 +++++++
 .../src/Tests/Migrate/MigrateTextConfigsTest.php   | 46 ++++++++++++++++++++++
 .../Tests/Migrate/d6/MigrateTextConfigsTest.php    | 46 ----------------------
 6 files changed, 65 insertions(+), 61 deletions(-)
 delete mode 100644 core/modules/text/migration_templates/d6_text_settings.yml
 create mode 100644 core/modules/text/migration_templates/text_settings.yml
 create mode 100644 core/modules/text/src/Tests/Migrate/MigrateTextConfigsTest.php
 delete mode 100644 core/modules/text/src/Tests/Migrate/d6/MigrateTextConfigsTest.php

diff --git a/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php b/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php
index 64e34d1..0591deb 100644
--- a/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php
+++ b/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php
@@ -359,6 +359,9 @@ public function load() {
       'name' => 'syslog_identity',
       'value' => 's:6:"drupal";',
     ))->values(array(
+      'name' => 'teaser_length',
+      'value' => 'i:1024;',
+    ))->values(array(
       'name' => 'theme_default',
       'value' => 's:6:"bartik";',
     ))->values(array(
@@ -476,4 +479,4 @@ public function load() {
   }
 
 }
-#a571d354b6652603b017f9647ce0975e
+#dbc0f593050ff48cc18dfa4fed47daaf
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php
index 9f3482c..b6ae809 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php
@@ -133,7 +133,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
     'd6_taxonomy_vocabulary',
     'd6_term_node_revision:*',
     'd6_term_node:*',
-    'd6_text_settings',
+    'text_settings',
     'd6_update_settings',
     'd6_upload_entity_display',
     'd6_upload_entity_form_display',
diff --git a/core/modules/text/migration_templates/d6_text_settings.yml b/core/modules/text/migration_templates/d6_text_settings.yml
deleted file mode 100644
index 8f6fff3..0000000
--- a/core/modules/text/migration_templates/d6_text_settings.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-id: d6_text_settings
-label: Drupal 6 teaser length configuration
-migration_tags:
-  - Drupal 6
-source:
-  plugin: variable
-  variables:
-    - teaser_length
-process:
-  default_summary_length: teaser_length
-destination:
-  plugin: config
-  config_name: text.settings
diff --git a/core/modules/text/migration_templates/text_settings.yml b/core/modules/text/migration_templates/text_settings.yml
new file mode 100644
index 0000000..45d426d
--- /dev/null
+++ b/core/modules/text/migration_templates/text_settings.yml
@@ -0,0 +1,14 @@
+id: text_settings
+label: Drupal teaser length configuration
+migration_tags:
+  - Drupal 6
+  - Drupal 7
+source:
+  plugin: variable
+  variables:
+    - teaser_length
+process:
+  default_summary_length: teaser_length
+destination:
+  plugin: config
+  config_name: text.settings
diff --git a/core/modules/text/src/Tests/Migrate/MigrateTextConfigsTest.php b/core/modules/text/src/Tests/Migrate/MigrateTextConfigsTest.php
new file mode 100644
index 0000000..0fbc1e9
--- /dev/null
+++ b/core/modules/text/src/Tests/Migrate/MigrateTextConfigsTest.php
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\text\Tests\Migrate\MigrateTextConfigsTest.
+ */
+
+namespace Drupal\text\Tests\Migrate;
+
+use Drupal\config\Tests\SchemaCheckTestTrait;
+use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
+
+/**
+ * Upgrade variables to text.settings.yml.
+ *
+ * @group text
+ */
+class MigrateTextConfigsTest extends MigrateDrupal6TestBase {
+
+  use SchemaCheckTestTrait;
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('text');
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->executeMigration('text_settings');
+  }
+
+  /**
+   * Tests migration of text variables to text.settings.yml.
+   */
+  public function testTextSettings() {
+    $config = $this->config('text.settings');
+    $this->assertIdentical(456, $config->get('default_summary_length'));
+    $this->assertConfigSchema(\Drupal::service('config.typed'), 'text.settings', $config->get());
+  }
+
+}
diff --git a/core/modules/text/src/Tests/Migrate/d6/MigrateTextConfigsTest.php b/core/modules/text/src/Tests/Migrate/d6/MigrateTextConfigsTest.php
deleted file mode 100644
index 440ffc0..0000000
--- a/core/modules/text/src/Tests/Migrate/d6/MigrateTextConfigsTest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\text\Tests\Migrate\d6\MigrateTextConfigsTest.
- */
-
-namespace Drupal\text\Tests\Migrate\d6;
-
-use Drupal\config\Tests\SchemaCheckTestTrait;
-use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
-
-/**
- * Upgrade variables to text.settings.yml.
- *
- * @group text
- */
-class MigrateTextConfigsTest extends MigrateDrupal6TestBase {
-
-  use SchemaCheckTestTrait;
-
-  /**
-   * Modules to enable.
-   *
-   * @var array
-   */
-  public static $modules = array('text');
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUp() {
-    parent::setUp();
-    $this->executeMigration('d6_text_settings');
-  }
-
-  /**
-   * Tests migration of text variables to text.settings.yml.
-   */
-  public function testTextSettings() {
-    $config = $this->config('text.settings');
-    $this->assertIdentical(456, $config->get('default_summary_length'));
-    $this->assertConfigSchema(\Drupal::service('config.typed'), 'text.settings', $config->get());
-  }
-
-}
-- 
2.3.2 (Apple Git-55)

